package se.wangs.decorator.interfacetype;

/**
 * -- coding: UTF-8 -- *
 *
 * @author wangs
 * @date 2023/12/11 15:55
 * @description 装饰器基类
 *              1) 继承饮料，表示其实加上调料之后，本质还是饮料
 *              2) 重写方法，不做别的，直接返回饮料的信息
 */
public class CondimentDecorator extends Beverage{

    protected Beverage beverage;

    public CondimentDecorator(Beverage beverage) {
        this.beverage = beverage;
    }

    @Override
    public String getName() {
        return beverage.getName();
    }

    @Override
    public double cost() {
        return beverage.cost();
    }
}
